package cn.jg.framework.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author fanfever
 * @date 2016/7/11
 */
@Data
@EqualsAndHashCode(callSuper = false)
public abstract class BaseException extends RuntimeException {

	private final String bizCode;

	protected ExceptionType type;

	BaseException(String bizCode) {
		super(bizCode);
		this.bizCode = bizCode;
	}

	protected BaseException(Throwable cause,String bizCode) {
		super(cause);
		this.bizCode = bizCode;
	}

	protected BaseException(String message, Throwable cause,String bizCode) {
		super(message, cause);
		this.bizCode = bizCode;
	}


	public enum ExceptionType {
		INFO, WARNING, ERROR
	}

	BaseException(String bizCode, Throwable cause) {
		super(bizCode, cause);
		this.bizCode = bizCode;
	}
}
